<?php
namespace app\api\forms;

use Phalcon\Forms\Form;

class FormBase extends Form
{
    public function getFirstMessageFor($name)
    {
        return $this->hasMessagesFor($name)?$this->getMessagesFor($name)->current():'';
    }

    public function getFirstMessage()
    {
        $messages = $this->getMessages(false);
        return count($messages)?$messages->current():'';
    }
}